﻿<%@ Page Title="" Language="C#" MasterPageFile="~/user/MasterPage2.master" AutoEventWireup="true" CodeFile="QueryNews1.aspx.cs" Inherits="user_QueryNews1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .auto-style8 {
            margin-left: 47px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:SqlDataSource ID="sdsQueryNews" runat="server" ConnectionString="<%$ ConnectionStrings:keshe2ConnectionString %>" DeleteCommand="DELETE FROM 通知 WHERE(编号=@编号)" SelectCommand="SELECT 编号,标题,内容,图片,时间 FROM 通知 ORDER BY 时间 DESC" ProviderName="<%$ ConnectionStrings:keshe2ConnectionString.ProviderName %>">
        <DeleteParameters>
            <asp:ControlParameter ControlID="GridView1" Name="编号" PropertyName="SelectedValue" />
        </DeleteParameters>
    </asp:SqlDataSource>
    <asp:Label ID="Label2" runat="server" Text="标题："></asp:Label>
    <asp:TextBox ID="txtValue" runat="server" Width="191px"></asp:TextBox>
    <asp:Button ID="btnQuery" runat="server" Text="查询" OnClick="btnQuery_Click" CssClass="auto-style8" />
    <br />
    <br />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="编号" DataSourceID="sdsQueryNews" CellPadding="4" ForeColor="#333333" GridLines="None" Width="1013px">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:BoundField DataField="编号" HeaderText="编号" InsertVisible="False" ReadOnly="True" SortExpression="编号" Visible="False" />
            <asp:HyperLinkField DataNavigateUrlFields="编号" DataNavigateUrlFormatString="~/user/NewsDetail.aspx?编号={0}" DataTextField="标题" HeaderText="标题">
            <ItemStyle Width="300px" />
            </asp:HyperLinkField>
            <asp:BoundField DataField="时间" HeaderText="时间" SortExpression="时间" >
            <ItemStyle Width="200px" />
            </asp:BoundField>
        </Columns>
        <EditRowStyle BackColor="#999999" />
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#E9E7E2" />
        <SortedAscendingHeaderStyle BackColor="#506C8C" />
        <SortedDescendingCellStyle BackColor="#FFFDF8" />
        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
    </asp:GridView>
</asp:Content>

